home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / Video.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  16.5 KB  |  430 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Video.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __VIDEO__
  18. #define __VIDEO__
  19.  
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24. /*    #include <Types.h>                                            */
  25. /*        #include <ConditionalMacros.h>                            */
  26. /*    #include <MixedMode.h>                                        */
  27. /*    #include <QuickdrawText.h>                                    */
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if GENERATINGPOWERPC
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #ifdef __CFM68K__
  38. #pragma lib_export on
  39. #endif
  40.  
  41.  
  42. enum {
  43.     mBaseOffset                    = 1,                            /*Id of mBaseOffset.*/
  44.     mRowBytes                    = 2,                            /*Video sResource parameter Id's */
  45.     mBounds                        = 3,                            /*Video sResource parameter Id's */
  46.     mVersion                    = 4,                            /*Video sResource parameter Id's */
  47.     mHRes                        = 5,                            /*Video sResource parameter Id's */
  48.     mVRes                        = 6,                            /*Video sResource parameter Id's */
  49.     mPixelType                    = 7,                            /*Video sResource parameter Id's */
  50.     mPixelSize                    = 8,                            /*Video sResource parameter Id's */
  51.     mCmpCount                    = 9,                            /*Video sResource parameter Id's */
  52.     mCmpSize                    = 10,                            /*Video sResource parameter Id's */
  53.     mPlaneBytes                    = 11,                            /*Video sResource parameter Id's */
  54.     mVertRefRate                = 14,                            /*Video sResource parameter Id's */
  55.     mVidParams                    = 1,                            /*Video parameter block id.*/
  56.     mTable                        = 2,                            /*Offset to the table.*/
  57.     mPageCnt                    = 3,                            /*Number of pages*/
  58.     mDevType                    = 4,                            /*Device Type*/
  59.     oneBitMode                    = 128,                            /*Id of OneBitMode Parameter list.*/
  60.     twoBitMode                    = 129,                            /*Id of TwoBitMode Parameter list.*/
  61.     fourBitMode                    = 130,                            /*Id of FourBitMode Parameter list.*/
  62.     eightBitMode                = 131                            /*Id of EightBitMode Parameter list.*/
  63. };
  64.  
  65. enum {
  66.     sixteenBitMode                = 132,                            /*Id of SixteenBitMode Parameter list.*/
  67.     thirtyTwoBitMode            = 133,                            /*Id of ThirtyTwoBitMode Parameter list.*/
  68.     firstVidMode                = 128,                            /*The new, better way to do the above. */
  69.     secondVidMode                = 129,                            /* QuickDraw only supports six video */
  70.     thirdVidMode                = 130,                            /* at this time.      */
  71.     fourthVidMode                = 131,
  72.     fifthVidMode                = 132,
  73.     sixthVidMode                = 133,
  74.     spGammaDir                    = 64,
  75.     spVidNamesDir                = 65
  76. };
  77.  
  78. /* csTimingFormat values in VDTimingInfo */
  79. /* look in the declaration rom for timing info */
  80. enum {
  81.     kDeclROMtables                = 'decl'
  82. };
  83.  
  84. /* Timing mode constants for Display Manager MultiMode support
  85.     Corresponding    .h equates are in Video.h
  86.                     .a equates are in Video.a
  87.                     .r equates are in DepVideoEqu.r
  88. */
  89. enum {
  90.     timingInvalid                = 0,                            /* Unknown timing… force user to confirm.*/
  91.     timingApple12                = 130,                            /*  512x384 (60 Hz) Rubik timing.*/
  92.     timingApple12x                = 135,                            /*  560x384 (60 Hz) Rubik-560 timing.*/
  93.     timingApple13                = 140,                            /*  640x480 (67 Hz) HR timing.*/
  94.     timingApple13x                = 145,                            /*  640x400 (67 Hz) HR-400 timing.*/
  95.     timingAppleVGA                = 150,                            /*  640x480 (60 Hz) VGA timing.*/
  96.     timingApple15                = 160,                            /*  640x870 (75 Hz) FPD timing.*/
  97.     timingApple15x                = 165,                            /*  640x818 (75 Hz) FPD-818 timing.*/
  98.     timingApple16                = 170,                            /*  832x624 (75 Hz) GoldFish timing.*/
  99.     timingAppleSVGA                = 180,                            /*  800x600 (56 Hz) SVGA timing.*/
  100.     timingApple1Ka                = 190,                            /* 1024x768 (60 Hz) VESA 1K-60Hz timing.*/
  101.     timingApple1Kb                = 200,                            /* 1024x768 (70 Hz) VESA 1K-70Hz timing.*/
  102.     timingApple19                = 210,                            /* 1024x768 (75 Hz) Apple 19" RGB.*/
  103.     timingApple21                = 220,                            /* 1152x870 (75 Hz) Apple 21" RGB.*/
  104.     timingAppleNTSC_ST            = 230,                            /*  512x384 (60 Hz, interlaced, non-convolved).*/
  105.     timingAppleNTSC_FF            = 232,                            /*  640x480 (60 Hz, interlaced, non-convolved).*/
  106.     timingAppleNTSC_STconv        = 234,                            /*  512x384 (60 Hz, interlaced, convolved).*/
  107.     timingAppleNTSC_FFconv        = 236,                            /*  640x480 (60 Hz, interlaced, convolved).*/
  108.     timingApplePAL_ST            = 238,                            /*  640x480 (50 Hz, interlaced, non-convolved).*/
  109.     timingApplePAL_FF            = 240,                            /*  768x576 (50 Hz, interlaced, non-convolved).*/
  110.     timingApplePAL_STconv        = 242,                            /*  640x480 (50 Hz, interlaced, non-convolved).*/
  111.     timingApplePAL_FFconv        = 244                            /*  768x576 (50 Hz, interlaced, non-convolved).*/
  112. };
  113.  
  114. /* csConnectFlags values in VDDisplayConnectInfo */
  115. enum {
  116.     kAllModesValid                = 0,                            /* All modes not trimmed by primary init are good close enough to try */
  117.     kAllModesSafe                = 1,                            /* All modes not trimmed by primary init are know to be safe */
  118.     kReportsTagging                = 2,                            /* Can detect tagged displays (to identify smart monitors) */
  119.     kHasDirectConnection        = 3,                            /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */
  120.     kIsMonoDev                    = 4,                            /* Says whether there’s an RGB (0) or Monochrome (1) connection. */
  121.     kUncertainConnection        = 5,                            /* There may not be a display (no sense lines?). */
  122.     kReservedConnectionBit        = 6,                            /* Reserved for now */
  123.     kReportsDDCConnection        = 7,                            /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */
  124.     kHasDDCConnection            = 8                                /* Card has ddc connect now. */
  125. };
  126.  
  127. /* csDisplayType values in VDDisplayConnectInfo */
  128. enum {
  129.     kUnknownConnect                = 1,                            /* Not sure how we’ll use this, but seems like a good idea. */
  130.     kPanelConnect                = 2,                            /* For use with fixed-in-place LCD panels. */
  131.     kPanelTFTConnect            = 2,                            /* Alias for kPanelConnect */
  132.     kFixedModeCRTConnect        = 3,                            /*  For use with fixed-mode (i.e., very limited range) displays. */
  133.     kMultiModeCRT1Connect        = 4,                            /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */
  134.     kMultiModeCRT2Connect        = 5,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */
  135.     kMultiModeCRT3Connect        = 6,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */
  136.     kMultiModeCRT4Connect        = 7,                            /* Expansion to large multi mode (not yet used) */
  137.     kModelessConnect            = 8,                            /* Expansion to modeless model (not yet used) */
  138.     kFullPageConnect            = 9,                            /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */
  139.     kVGAConnect                    = 10,                            /* 640x480 VGA default -- question everything else */
  140.     kNTSCConnect                = 11,                            /* NTSC ST (default), FF, STconv, FFconv */
  141.     kPALConnect                    = 12,                            /* PAL ST (default), FF, STconv, FFconv */
  142.     kHRConnect                    = 13,                            /* 640x400 (to get 8bpp in 256K case) and 640x480 (these two only) */
  143.     kPanelFSTNConnect            = 14                            /* For use with fixed-in-place LCD FSTN (aka “Supertwist”) panels */
  144. };
  145.  
  146. /* csTimingFlags values in VDTimingInfoRec */
  147. enum {
  148.     kModeValid                    = 0,                            /* Says that this mode should NOT be trimmed. */
  149.     kModeSafe                    = 1,                            /* This mode does not need confirmation */
  150.     kModeDefault                = 2,                            /* This is the default mode for this type of connection */
  151.     kModeShowNow                = 3,                            /* This mode should always be shown (even though it may require a confirm) */
  152.     kModeNotResize                = 4                                /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */
  153. };
  154.  
  155. enum {
  156. /* Control Codes */
  157.     cscReset                    = 0,
  158.     cscKillIO                    = 1,
  159.     cscSetMode                    = 2,
  160.     cscSetEntries                = 3,
  161.     cscSetGamma                    = 4,
  162.     cscGrayPage                    = 5,
  163.     cscGrayScreen                = 5,
  164.     cscSetGray                    = 6,
  165.     cscSetInterrupt                = 7,
  166.     cscDirectSetEntries            = 8,
  167.     cscSetDefaultMode            = 9,
  168.     cscSwitchMode                = 10,
  169.     cscSetSync                    = 11,
  170.     cscSavePreferredConfiguration = 16
  171. };
  172.  
  173. enum {
  174. /* Status Codes */
  175.     cscGetMode                    = 2,
  176.     cscGetEntries                = 3,
  177.     cscGetPageCnt                = 4,
  178.     cscGetPages                    = 4,                            /* This is what C&D 2 calls it. */
  179.     cscGetPageBase                = 5,
  180.     cscGetBaseAddr                = 5,                            /* This is what C&D 2 calls it. */
  181.     cscGetGray                    = 6,
  182.     cscGetInterrupt                = 7,
  183.     cscGetGamma                    = 8,
  184.     cscGetDefaultMode            = 9,
  185.     cscGetCurMode                = 10,
  186.     cscGetSync                    = 11,
  187.     cscGetConnection            = 12,                            /* Return information about the connection to the display */
  188.     cscGetModeTiming            = 13,                            /* Return timing info for a mode */
  189.     cscGetModeBaseAddress        = 14,                            /* Return base address information about a particular mode */
  190.     cscGetScanProc                = 15,                            /* QuickTime scan chasing routine */
  191.     cscGetPreferredConfiguration = 16,
  192.     cscGetNextResolution        = 17,
  193.     cscGetVideoParameters        = 18,
  194.     cscGetGammaList                = 19
  195. };
  196.  
  197. /* Bit definitions for the Get/Set Sync call*/
  198. enum {
  199.     kHorizontalSyncDisableBit    = 0,
  200.     kVerticalSyncDisableBit        = 1,
  201.     kCompositeSyncDisableBit    = 2,
  202.     kSyncOnRedEnableBit            = 3,
  203.     kSyncOnGreenEnableBit        = 4,
  204.     kSyncOnBlueEnableBit        = 5,
  205.     kHorizontalSyncMask            = 0x01,
  206.     kVerticalSyncMask            = 0x02,
  207.     kCompositeSyncMask            = 0x04,
  208.     kDPMSSyncMask                = 0x7,
  209.     kSyncOnRedMask                = 0x08,
  210.     kSyncOnGreenMask            = 0x10,
  211.     kSyncOnBlueMask                = 0x20,
  212.     kSyncOnMask                    = 0x38
  213. };
  214.  
  215. struct VPBlock {
  216.     long                            vpBaseOffset;                /*Offset to page zero of video RAM (From minorBaseOS).*/
  217.     short                            vpRowBytes;                    /*Width of each row of video memory.*/
  218.     Rect                            vpBounds;                    /*BoundsRect for the video display (gives dimensions).*/
  219.     short                            vpVersion;                    /*PixelMap version number.*/
  220.     short                            vpPackType;
  221.     long                            vpPackSize;
  222.     long                            vpHRes;                        /*Horizontal resolution of the device (pixels per inch).*/
  223.     long                            vpVRes;                        /*Vertical resolution of the device (pixels per inch).*/
  224.     short                            vpPixelType;                /*Defines the pixel type.*/
  225.     short                            vpPixelSize;                /*Number of bits in pixel.*/
  226.     short                            vpCmpCount;                    /*Number of components in pixel.*/
  227.     short                            vpCmpSize;                    /*Number of bits per component*/
  228.     long                            vpPlaneBytes;                /*Offset from one plane to the next.*/
  229. };
  230. typedef struct VPBlock VPBlock;
  231.  
  232. typedef VPBlock *VPBlockPtr;
  233.  
  234. struct VDEntryRecord {
  235.     Ptr                                csTable;                    /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
  236. };
  237. typedef struct VDEntryRecord VDEntryRecord;
  238.  
  239. typedef VDEntryRecord *VDEntRecPtr;
  240.  
  241. /* Parm block for SetGray control call */
  242. struct VDGrayRecord {
  243.     Boolean                            csMode;                        /*Same as GDDevType value (0=mono, 1=color)*/
  244.     SInt8                            filler;
  245. };
  246. typedef struct VDGrayRecord VDGrayRecord;
  247.  
  248. typedef VDGrayRecord *VDGrayPtr;
  249.  
  250. /* Parm block for SetEntries control call */
  251. struct VDSetEntryRecord {
  252.     ColorSpec                        *csTable;                    /*Pointer to an array of color specs*/
  253.     short                            csStart;                    /*Which spec in array to start with, or -1*/
  254.     short                            csCount;                    /*Number of color spec entries to set*/
  255. };
  256. typedef struct VDSetEntryRecord VDSetEntryRecord;
  257.  
  258. typedef VDSetEntryRecord *VDSetEntryPtr;
  259.  
  260. /* Parm block for SetGamma control call */
  261. struct VDGammaRecord {
  262.     Ptr                                csGTable;                    /*pointer to gamma table*/
  263. };
  264. typedef struct VDGammaRecord VDGammaRecord;
  265.  
  266. typedef VDGammaRecord *VDGamRecPtr;
  267.  
  268. struct VDSwitchInfoRec {
  269.     unsigned short                    csMode;                        /*(word) mode depth*/
  270.     unsigned long                    csData;                        /*(long) functional sResource of mode*/
  271.     unsigned short                    csPage;                        /*(word) page to switch in*/
  272.     Ptr                                csBaseAddr;                    /*(long) base address of page (return value)*/
  273.     unsigned long                    csReserved;                    /*(long) Reserved (set to 0) */
  274. };
  275. typedef struct VDSwitchInfoRec VDSwitchInfoRec;
  276.  
  277. typedef VDSwitchInfoRec *VDSwitchInfoPtr;
  278.  
  279. struct VDTimingInfoRec {
  280.     unsigned long                    csTimingMode;                /* LONGINT - (long) timing mode (a la InitGDevice) */
  281.     unsigned long                    csTimingReserved;            /* LONGINT - (long) reserved */
  282.     unsigned long                    csTimingFormat;                /* LONGINT - (long) what format is the timing info */
  283.     unsigned long                    csTimingData;                /* LONGINT - (long) data supplied by driver */
  284.     unsigned long                    csTimingFlags;                /* LONGINT - (long) mode within device */
  285. };
  286. typedef struct VDTimingInfoRec VDTimingInfoRec;
  287.  
  288. typedef VDTimingInfoRec *VDTimingInfoPtr;
  289.  
  290. struct VDDisplayConnectInfoRec {
  291.     unsigned short                    csDisplayType;                /* INTEGER - (word) Type of display connected */
  292.     unsigned short                    csConnectTagged;            /* INTEGER - (word) Display is currently "it" (tagged to identify component) */
  293.     unsigned long                    csConnectFlags;                /* LONGINT - (long) tell us about the connection */
  294.     unsigned long                    csDisplayComponent;            /* LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) */
  295.     unsigned long                    csConnectReserved;            /* LONGINT - (long) reserved */
  296. };
  297. typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec;
  298.  
  299. typedef VDDisplayConnectInfoRec *VDDisplayConnectInfoPtr;
  300.  
  301. struct VDPageInfo {
  302.     short                            csMode;                        /*(word) mode within device*/
  303.     long                            csData;                        /*(long) data supplied by driver*/
  304.     short                            csPage;                        /*(word) page to switch in*/
  305.     Ptr                                csBaseAddr;                    /*(long) base address of page*/
  306. };
  307. typedef struct VDPageInfo VDPageInfo;
  308.  
  309. typedef VDPageInfo *VDPgInfoPtr;
  310.  
  311. struct VDSizeInfo {
  312.     short                            csHSize;                    /*(word) desired/returned h size*/
  313.     short                            csHPos;                        /*(word) desired/returned h position*/
  314.     short                            csVSize;                    /*(word) desired/returned v size*/
  315.     short                            csVPos;                        /*(word) desired/returned v position*/
  316. };
  317. typedef struct VDSizeInfo VDSizeInfo;
  318.  
  319. typedef VDSizeInfo *VDSzInfoPtr;
  320.  
  321. struct VDSettings {
  322.     short                            csParamCnt;                    /*(word) number of params*/
  323.     short                            csBrightMax;                /*(word) max brightness*/
  324.     short                            csBrightDef;                /*(word) default brightness*/
  325.     short                            csBrightVal;                /*(word) current brightness*/
  326.     short                            csCntrstMax;                /*(word) max contrast*/
  327.     short                            csCntrstDef;                /*(word) default contrast*/
  328.     short                            csCntrstVal;                /*(word) current contrast*/
  329.     short                            csTintMax;                    /*(word) max tint*/
  330.     short                            csTintDef;                    /*(word) default tint*/
  331.     short                            csTintVal;                    /*(word) current tint*/
  332.     short                            csHueMax;                    /*(word) max hue*/
  333.     short                            csHueDef;                    /*(word) default hue*/
  334.     short                            csHueVal;                    /*(word) current hue*/
  335.     short                            csHorizDef;                    /*(word) default horizontal*/
  336.     short                            csHorizVal;                    /*(word) current horizontal*/
  337.     short                            csHorizMax;                    /*(word) max horizontal*/
  338.     short                            csVertDef;                    /*(word) default vertical*/
  339.     short                            csVertVal;                    /*(word) current vertical*/
  340.     short                            csVertMax;                    /*(word) max vertical*/
  341. };
  342. typedef struct VDSettings VDSettings;
  343.  
  344. typedef VDSettings *VDSettingsPtr;
  345.  
  346. typedef unsigned long DisplayModeID;
  347.  
  348. typedef unsigned long VideoDeviceType;
  349.  
  350. typedef unsigned short DepthMode;
  351.  
  352. typedef unsigned long GammaTableID;
  353.  
  354.  
  355. enum {
  356.     kFirstDepthMode                = 128,
  357.     kSecondDepthMode            = 129,
  358.     kThirdDepthMode                = 130,
  359.     kFourthDepthMode            = 131,
  360.     kFifthDepthMode                = 132,
  361.     kSixthDepthMode                = 133
  362. };
  363.  
  364. struct VDResolutionInfoRec {
  365.     DisplayModeID                    csPreviousDisplayModeID;    /* ID of the previous resolution in a chain */
  366.     DisplayModeID                    csDisplayModeID;            /* ID of the next resolution */
  367.     unsigned long                    csHorizontalPixels;            /* # of pixels in a horizontal line */
  368.     unsigned long                    csVerticalLines;            /* # of lines in a screen */
  369.     Fixed                            csRefreshRate;                /* Vertical Refresh Rate in Hz */
  370.     DepthMode                        csMaxDepthMode;                /* 0x80-based number representing max bit depth */
  371.     unsigned long                    csReserved;                    /* Reserved */
  372.     unsigned long                    csReserved1;                /* Reserved */
  373. };
  374. typedef struct VDResolutionInfoRec VDResolutionInfoRec;
  375.  
  376. typedef VDResolutionInfoRec *VDResolutionInfoPtr;
  377.  
  378. struct VDVideoParametersInfoRec {
  379.     DisplayModeID                    csDisplayModeID;            /* the ID of the resolution we want info on */
  380.     DepthMode                        csDepthMode;                /* The bit depth we want the info on (0x80 based) */
  381.     VPBlockPtr                        csVPBlockPtr;                /* Pointer to a video parameter block */
  382.     unsigned long                    csPageCount;                /* Number of pages supported by the resolution */
  383.     VideoDeviceType                    csDeviceType;                /* Device Type:  Direct, Fixed or CLUT; */
  384.     unsigned long                    csReserved;                    /* Reserved */
  385. };
  386. typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec;
  387.  
  388. typedef VDVideoParametersInfoRec *VDVideoParametersInfoPtr;
  389.  
  390. struct VDGammaInfoRec {
  391.     GammaTableID                    csLastGammaID;                /* the ID of the previous gamma table */
  392.     GammaTableID                    csNextGammaID;                /* the ID of the next gamma table */
  393.     Ptr                                csGammaPtr;                    /* Ptr to a gamma table data */
  394.     unsigned long                    csReserved;                    /* Reserved */
  395. };
  396. typedef struct VDGammaInfoRec VDGammaInfoRec;
  397.  
  398. typedef VDGammaInfoRec *VDGammaInfoPtr;
  399.  
  400. struct VDDefMode {
  401.     UInt8                            csID;
  402.     SInt8                            filler1;
  403. };
  404. typedef struct VDDefMode VDDefMode;
  405.  
  406. typedef VDDefMode *VDDefModePtr;
  407.  
  408. struct VDSyncInfoRec {
  409.     UInt8                            csMode;
  410.     UInt8                            csFlags;
  411. };
  412. typedef struct VDSyncInfoRec VDSyncInfoRec;
  413.  
  414. typedef VDSyncInfoRec *VDSyncInfoPtr;
  415.  
  416.  
  417. #ifdef __CFM68K__
  418. #pragma lib_export off
  419. #endif
  420.  
  421. #if GENERATINGPOWERPC
  422. #pragma options align=reset
  423. #endif
  424.  
  425. #ifdef __cplusplus
  426. }
  427. #endif
  428.  
  429. #endif /* __VIDEO__ */
  430.